<?php
/**
 * Return a text file with the json of the current user.
 *
 * http://mydomain.ext/scripts/get_json_user.php
 */
defined( '_ENTRY_' ) or die ( 'Restricted Access' );

import("includes.session");
import("core.DB");
import("core.User");

$db = get_session_db();

if(!user_is_logged($db))
{
	//header("Location:http://".LOGIN_FILE);
	echo "{ \"status\":\"user not logged\" }";
	exit();
}

$user = get_session_user();

echo $user->getJSON();
?>